3d71e17b66fe24dd22456aa35236248a27151e43,src/main/java/modtweaker2/mods/mekanism/handlers/ChemicalCrystallizer.java,ChemicalCrystallizer,removeRecipe,#IItemStack#,30
Before Change
@ZenMethod
public static void removeRecipe(IItemStack output) {
if (!Mekanism.v7) throw new UnsupportedOperationException("Function not added to v8 compatibility yet");
MineTweakerAPI.apply(new RemoveMekanismRecipe("CHEMICAL_CRYSTALLIZER", Recipe.CHEMICAL_CRYSTALLIZER.get(), toStack(output)));
}
}
After Change
@SuppressWarnings({ "unchecked", "rawtypes" })
@ZenMethod
public static void removeRecipe(IIngredient itemOutput, @Optional IIngredient gasInput) {
if(itemOutput == null) {
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
return;
}
if(gasInput == null) gasInput = IngredientAny.INSTANCE;
Map<MachineInput, MachineRecipe> recipes = new HashMap<MachineInput, MachineRecipe>();
for(Entry<GasInput, CrystallizerRecipe> entry : ((Map<GasInput, CrystallizerRecipe>)Recipe.CHEMICAL_CRYSTALLIZER.get()).entrySet()) {
IGasStack inputGas = new MCGasStack(entry.getKey().ingredient);
IItemStack outputItem = InputHelper.toIItemStack(entry.getValue().recipeOutput.output);
if(!StackHelper.matches(itemOutput, outputItem)) continue;
if(!StackHelper.matches(gasInput, inputGas)) continue;
recipes.put(entry.getKey(), entry.getValue());
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new RemoveMekanismRecipe(name, Recipe.CHEMICAL_CRYSTALLIZER.get(), recipes));
} else {
LogHelper.logWarning(String.format("No %s recipe found for %s and %s. Command ignored!", name, gasInput.toString(), itemOutput.toString()));
}
}
}